package com.zy.advice;

import org.springframework.aop.ThrowsAdvice;

/**
 * @author LittleDesire
 * @description
 * @date 2022-04-06 周三 17:17
 * @since 17
 */
public class MyThrowsAdvice implements ThrowsAdvice {

    public void afterThrowing(Exception ex) {
        StackTraceElement[] stackTrace = ex.getStackTrace();
        for (StackTraceElement stackTraceElement : stackTrace) {
            System.out.println("异常通知" + stackTraceElement);
        }
    }
}
